import java.util.Scanner;

public class TestDemo {
    public static int sumAdd(int n) {
    if (n==1){
        return 1;
    }
    return n+sumAdd(n-1);
    }
    public static void main1(String[] args) {
        System.out.println(sumAdd(5));
    }
//打印每一位
    public static void print(int n) {
        if (n<10) {
            System.out.print(n+" ");
        }else{
            print(n/10);
            System.out.print(n%10+" ");
        }
    }
    public static void main2(String[] args) {
        print(1234);
    }
    //n的阶乘和
    public static int sumMul(int n) {
            if (n==1){
                return 1;
            }
            return n*sumMul(n-1);
        }

    public static int sum(int n) {
        if (n==1){
            return 1;
        }
        return sumMul(n)+sum(n-1);
    }
    public static void main3(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        System.out.println(sum(n));
    }
    //输入每一位然后相加
    public static int sumEveryone(int n) {
        if (n <10) {
            return n;
        }else{
            return sumEveryone(n/10)+n%10;
        }
    }
    public static void main4(String[] args) {
        System.out.println(sumEveryone(1234));
    }
    //n的阶乘
    public static int Mul(int n) {
        if (n==1){
            return 1;
        }
        return n*Mul(n-1);
    }
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        System.out.println(Mul(n));
    }
}
